
***************************************************************	
	


use Data/bypostcode.dta, clear
	
	
	merge 1:1 postcode using Data/Census2006postcode.dta
	
	drop if _merge ==2
	
	
	gen nexis_buildings = ROOFME/PROOFME

	gen RoofRelative = (roofratio*nexis_buildings)/1000

	
	replace TotalHouse = TotalHouse/1000
	
	label variable TotalHouse "Dwellings (000)"
	label variable median_income "Median Income (000/week)"
	label variable median_age "Median Age"
	label variable PSeparateHouse "Proportion Separate Dwellings"
	label variable median_rooms "Median House Size"
	label variable PFullTime "Proportion Employed Full Time"
	label variable median_mortgage "Median Mortgage Payment (000/month)"
	label variable median_rent "Median Rental Payment (000/week)"
	label variable PBachelor "Proportion Bachelor Degree"
	label variable PRented "Proportion Rental Property"

	label variable RoofRelative "Scaled Roof Ratio"
	
	
	
	
	
	reg RoofRelative 	TotalHouse median_income median_age PSeparateHouse median_rooms PFullTime median_mortgage median_rent PBachelor PRented [ aweight = NCustomer_pcode]
	
	quietly summ RoofRelative [aweight =NCustomer	] if e(sample)
    local meandepvar=round(`r(mean)',.001)
	
	outreg2 using Analysis/Balance.tex, bdec(3) label addstat(F, e(F))	tex(fragment pretty) nonotes replace nocons addtext(Mean dep var, `meandepvar') ///

	
	
	rlasso RoofRelative 	TotalHouse median_income median_age PSeparateHouse median_rooms PFullTime median_mortgage median_rent PBachelor PRented [ aweight = NCustomer_pcode]
	
	
	
	
	local selvarlist = e(selected)	

	reg RoofRelative `selvarlist'  [ aweight = NCustomer_pcode]
	
		outreg2 using Analysis/Balance.tex, bdec(3) label addstat(F, e(F)) 	tex(fragment pretty) nonotes append nocons addtext(Mean dep var, `meandepvar')

	
